<!DOCTYPE html>
<html lang="en">
    <head>
        <meta charset="UTF-8" />
        <meta name="viewport" content="width=device-width, initial-scale=1.0" />
        <title>Document</title>
    </head>
    <body>
        <script>
            // 对象的简写 name:name 简写的对象方法不能用作构造函数，否则会报错

            // 表达式的写法
            let name = 'zs';
            let obj = {
                [name]: 'lisi',
                age: 19,
            };
            console.log(obj[name], obj.zs);

            // super继承原型对象上的属性和方法
            function Person(name, age) {
                this.name = name;
                this.age = age;
            }
            Person.prototype.getName = function () {
                return this.name;
            };
            function Son(name, age) {
                super(name, age);
                this.getName = function () {
                    super();
                };
            }
        </script>
    </body>
</html>
